package com.hmis.dao;

import com.hmis.domain.Department;
import com.hmis.service.DepartmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
@Controller
public class DepartmentDAO implements InitializingBean {


    public static DepartmentService departmentService;
    public static DepartmentDAO departmentDAO;
    @Autowired
    private DepartmentService department;

    public List<Department> list() {
        return departmentService.list();
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        departmentService = department;
        departmentDAO = this;
    }

}
